package com.example.xinhuazidian.utils

object OneClickThree {
    // 两次点击间隔不能少于n秒 true:点击间隔小于n秒 false:点击间隔大于n秒
    private const val FAST_CLICK_DELAY_TIME = 1000 * 1
    private var lastClickTime: Long = 0
    val isFastClick: Boolean
        get() {
            var flag = true
            val currentClickTime = System.currentTimeMillis()
            if (currentClickTime - lastClickTime >= FAST_CLICK_DELAY_TIME) {
                flag = false
            }
            lastClickTime = currentClickTime
            return flag
        }
}